fix: only set keep-alive header before Node.js 14.8.0#4457
Merged
Conversation
fengmk2
reviewed
Sep 7, 2020
| // try to support Keep-Alive Header when < 14.8.0 | ||
| const server = ctx.app.server; | ||
| if (server && server.keepAliveTimeout && server.keepAliveTimeout >= 1000 && ctx.header.connection !== 'close') { | ||
| if (shouldPatchKeepAliveHeader && server && server.keepAliveTimeout && server.keepAliveTimeout >= 1000 && ctx.header.connection !== 'close') { |
Member
Author
There was a problem hiding this comment.
Codecov Report
@@ Coverage Diff @@
## master #4457 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 34 34
Lines 955 957 +2
=========================================
+ Hits 955 957 +2
Continue to review full report at Codecov.
|
killagu
reviewed
Sep 7, 2020
dead-horse
reviewed
Sep 7, 2020
37ebd24 to
bd5cb2d
Compare
fengmk2
approved these changes
Sep 8, 2020
Member
|
@atian25 你来发版本 |
Member
Author
|
等 #4421 一起发 |
popomore
pushed a commit
that referenced
this pull request
Sep 8, 2020
fix: only set keep-alive header before Node.js 14.8.0 (#4457)
Member
Author
|
12跟14都merge了 keep_alive 的代码。现在在12上keep_alive会设置两次。 |
Member
Author
|
哪个 PR? 14 那个我提的,node 本身会判断,不会设置两次的 |
|
v12.19.0 proposal nodejs/node#35401 |
Member
Author
|
@qingdengyue 可以去蹭个 PR 了,把我那个 backport 回去 12 吧 |
|
@atian25 已提交 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Checklist
npm testpassesAffected core subsystem(s)
Description of change
Node.js 14.8.0 will set Keep-Alive header, so it'll be dup
unittest is here: https://github.com/eggjs/egg/blob/master/test/app/middleware/meta.test.js#L67